#ifndef IMAGE_H
#define IMAGE_H
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;

class image {
 public:
  vector <int> size; //vector with two elements: horizontal and vertical picture size
  vector < vector <double> > initial; //intial array of pixel values
  vector < vector <double> > transpose; //tranpose of initial matrix
  vector <double> eigenvalues; //vector of eigenvalues
  vector <double> singularvalues; //vector of singular values
  vector < vector <double> > singularmatrix; //matrix w/ singular value diagonal
  //vector < vector <double> > eigendomain; //eigenvectors of domain space V~ is nxn
  vector < vector <double> > eigenrange; //eigenvectors of range space W~ is mxr where r = number of good eigenvectors & eigenvalues
  vector < vector <double> > hermetian; //hermetian square
  //vector < vector <double> > modulus;
  vector < vector <double> > randomBasis; //random basis becomes matrix of eigenvectors
  vector < vector <double> > eigenvectors;
  vector < vector <double> > SVD;
  double epsilon; //arbitrary tolerance value
  double cutoff;
  image();
  ~image();
  void print(vector < vector <double> >, int, int);
  void createRandomBasis(int);
  vector < vector <double> > gramSchmidt(vector < vector <double> >, int, int);
  vector < vector <double> > computetranspose(vector < vector <double> >, int, int);
  vector < vector <double> > multiply(vector < vector <double> >, vector < vector <double> >, int, int, int, int);
  vector < vector <double> > subtract(vector < vector <double> >, vector < vector <double> >, int, int, int, int);
  bool check_tolerance(vector < vector <double> >, int, int);
  int computeEigenmatrix(vector < vector <double> >, int);
  double computeEigenvalue(vector < vector <double> > , vector < vector <double> >, int);
  void computeSingularValues();
  vector < vector <double> > scalarMultiplyColumn(vector < vector <double> >, double, int, int, int);
  void computeEigenrange();
  void computeSVD();

};

#endif
